import { createStore, applyMiddleware } from 'redux';
// import createSagaMiddleware from 'redux-saga';
import createSagaMiddleware from '../yl-redux-saga';

import reducer from './reducers';

// 导入我们的 saga
import mySaga from './action/loginSaga';

// 创建 saga中间件
const sagaMiddleware = createSagaMiddleware();

// 使用 中间件
const store = createStore(reducer, applyMiddleware(sagaMiddleware));

// 在这里启动监听
sagaMiddleware.run(mySaga);

export default store;
